package com.yuexunit.finance.member.service;

import org.hibernate.criterion.DetachedCriteria;

import com.yuexunit.finance.member.entity.SupplierCommissionInfoEntity;
import com.yuexunit.inject.annotation.Implements;
import com.yuexunit.page.PageCriteria;
import com.yuexunit.page.PageList;
import com.yuexunit.persist.PersistUtil;
import com.yuexunit.persist.annotation.Transactional;

/**
*@version 创建时间：2016年9月27日 上午10:50:13
*@author NTBK-021-1006
*类说明
*/

@Implements(SupplierCommissionInfoService.class)
public class SupplierCommissionInfoServiceImpl implements SupplierCommissionInfoService {

	@Override
	@Transactional
	public Long createSupplierCommissionInfo(SupplierCommissionInfoEntity entity) {
		PersistUtil.insert(entity);
		return entity.getEnterpriseId();
	}

	@Override
	@Transactional
	public void updateSupplierCommissionInfo(SupplierCommissionInfoEntity entity) {
		PersistUtil.update(entity);
	}

	@Override
	public SupplierCommissionInfoEntity inquireSupplierCommissionInfo(Long enterpriseId) {
		return PersistUtil.get(SupplierCommissionInfoEntity.class, enterpriseId);
	}

	@Override
	public PageList<SupplierCommissionInfoEntity> inquireSupplierCommissionInfoPageList(PageCriteria page) {
		DetachedCriteria criteria = DetachedCriteria.forClass(SupplierCommissionInfoEntity.class);
		return PersistUtil.get(criteria, page);
	}
}
